import request from '@/utils/request'

// 获取房产列表
export function getProperties(params) {
  return request({
    url: '/properties',
    method: 'get',
    params
  })
}

// 获取房产数量
export function getProCount(params) {
  return request({
    url: '/properties/count',
    params
  })
}

// 获取指定房产
export function getProDate(id) {
  return request({
    url: `/properties/${id}`
  })
}

// 新建房产

export function addPro(data) {
  return request({
    url: '/properties',
    method: 'post',
    data
  })
}

// 编制房产
export function editPro(data) {
  return request({
    url: `/properties/${data.id}`,
    method: 'put',
    data
  })
}

// 删除房产
export function delPro(id) {
  return request({
    url: `/properties/${id}`,
    method: 'DELETE'
  })
}
